﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;



namespace Demos.WebForms
{
	public partial class _Default : System.Web.UI.Page
	{
		public void Simulate_Click(object sender, EventArgs e)
		{
			Session.Add(Classes.MobileSimulator.Key, true);
		}

		protected void Page_PreRender(object sender, EventArgs e)
		{
			var device = HttpContext.Current.GetDevice();
			var caps = device.GetCapabilities();

			UserAgentLabel.Text = device.UserAgent;

			foreach (var cap in caps)
			{
				CapabilitiesLabel.Text += String.Concat("<div>", cap.Key, " = ", cap.Value, "</div>");
			}
		}
	}
}
